package cn.tedu.hotel.serve.pojo.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class OrdersDTO implements Serializable {
    @NotNull(message = "必须填写用户名")
    private String username;

    @NotNull(message = "必须填写用户ID")
    private Long userId;

    @NotNull(message = "必须填写手机号码")
    @NotEmpty(message = "必须填写手机号码")
    @Pattern(regexp = "^1[3,4,5,6,7,8,9]\\d{9}$",message = "手机号码格式不正确")
    private String phone;

    @NotNull(message = "必须填写真实姓名")
    @NotEmpty(message = "必须填写真实姓名")
    @NotBlank(message = "必须填写真实姓名")
    private String realName;

    @NotNull(message = "必须填写身份证号")
    @NotEmpty(message = "必须填写身份证号")
    @Pattern(regexp = "^\\d{15}|\\d{18}$",message = "身份证号码格式错误")
    private String idCard;

    @NotNull(message = "必须填写酒店名字")
    private String hotelName;

    @NotNull(message = "必须填写酒店ID")
    private Long hotelId;
    @NotNull(message = "必须填写房间名字")
    private String roomName;
    @NotNull(message = "必须填写房间ID")
    private Long roomId;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime checkInTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime departureTime;
    @Range(min = 1,message = "请选择人数")
    private Integer numberOfPeople;
    @Range(min = 1,message = "请选择预定的房间数")
    private Integer countOfBuyRooms;
}
